package com.tess.tboot.dao.mapper;

import com.tess.tboot.base.TbootBaseMapper;
import com.tess.tboot.entity.Menu;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author duanzonglong
 */
public interface MenuMapper extends TbootBaseMapper<Menu> {
    /**
     * 获取一级菜单
     *
     * @param parent
     * @return
     */
    @Select("select * from t_menu where parent=#{parent}")
    List<Menu> findByParent(Boolean parent);

    /**
     * 通过parendId查找
     *
     * @param parentId
     * @return
     */
    @Select("select * from t_menu where parent_id=#{parentId}")
    List<Menu> findByParentId(String parentId);
}
